package com.seria.test01;

import java.io.FileInputStream;
import java.io.ObjectInputStream;

public class ReadInstance {
	public static void main(String[] args) throws Exception {
		if (args.length != 1) {
			// System.out.println("usage: java ReadInstance filename");
			// System.exit(-1);
			args = new String[1];
			args[0] = new String("people");
		}
		FileInputStream fis = new FileInputStream(args[0]);
		ObjectInputStream ois = new ObjectInputStream(fis);
		Object o;
		// while (true) {
		o = ois.readObject();
		System.out.println("read object " + o);
		// }
		System.out.println(((Person)o).getPopulation());
	}
}
